local juexi = fk.CreateSkill{
  name = "hanqing__juexi",
}

Fk:loadTranslationTable{
  ["hanqing__juexi"] = "绝息",
  [":hanqing__juexi"] = "出牌阶段，你可以令一名有“狂风”标记的其他角色获得其装备区的所有牌并移去其所有“狂风”标记，本回合其所有牌视为【闪】，"..
  "然后视为对其使用等量张【杀】（无次数限制，计入次数）。",

  ["#hanqing__juexi"] = "绝息：移去一名角色的“狂风”标记，其收回装备，视为对其使用等量【杀】！",
  ["@@hanqing__juexi-turn"] = "绝息",

  ["$hanqing__juexi1"] = "吐天吴、驱风伯，欲使湖海无涟漪。",
  ["$hanqing__juexi2"] = "晶甲明，草木偃，飞矢星落，江河斡旋。",
}

juexi:addEffect("active", {
  anim_type = "offensive",
  prompt =  "#hanqing__juexi",
  card_num = 0,
  target_num = 1,
  can_use = Util.TrueFunc,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select ~= player and to_select:getMark("@@kuangfeng") > 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local n = target:getMark("@@kuangfeng")
    room:setPlayerMark(target, "@@kuangfeng", 0)
    room:setPlayerMark(target, "@@hanqing__juexi-turn", 1)
    if #target:getCardIds("e") > 0 then
      room:moveCardTo(target:getCardIds("e"), Card.PlayerHand, target, fk.ReasonJustMove, juexi.name, nil, true, target)
    end
    if target.dead then return end
    for _ = 1, n do
      if player.dead or target.dead then return end
      room:useVirtualCard("slash", nil, player, target, juexi.name, false)
    end
  end,
})

juexi:addEffect("filter", {
  mute = true,
  card_filter = function(self, card, player)
    return player:getMark("@@hanqing__juexi-turn") > 0 and table.contains(player:getCardIds("h"), card.id)
  end,
  view_as = function(self, player, card)
    return Fk:cloneCard("jink", card.suit, card.number)
  end,
})

return juexi
